<template>
  <div>
    <div class="box">
        <h4>租房小组</h4>
        <span>更多</span>
    </div>
    <ul class="GroupTags">
        <li v-for="(item,index) in list" :key="index">
            <div class="group_info">
                <p>{{item.title}}</p>
                <span>{{item.desc}}</span>
            </div>
            <div class="group_bg">
                <img :src="item.imgSrc" alt="">
            </div>
        </li>
    </ul>
  </div>
</template>

<script>
import { group } from '@/api/RentalGroup'
export default {
  data () {
    return {
      list: []
    }
  },
  methods: {
    async GetGroup () {
      const res = await group()
      console.log('res', res)
      this.list = res.body
      for (let i = 0; i < this.list.length; i++) {
        this.list[i].imgSrc = `http://124.223.73.204:8080${this.list[i].imgSrc}`
      }
    }
  },
  mounted () {
    this.GetGroup()
  }
}
</script>

<style scoped lang='less'>
.box{
    width:356px;
    height: 40px;
    margin:0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    h4{
        display: inline;
    }
}
.GroupTags{
    width:356px;
    margin:0 auto;
    display: flex;
    justify-content: space-between;
    align-content: center;
    flex-wrap:wrap;
    li{
        display: flex;
        justify-content: space-around;
        align-content: center;
        margin-bottom: 10px;
        padding-top: 10px;
        span{
            color: #bababa;
            font-size: 14px;
        }
    }
    li:nth-child(odd){
        width: 172px;
        height: 75px;
        background-color: white;
    }
    li:nth-child(even){
        width: 172px;
        height: 75px;
        background-color: white;
    }
}
.group_bg{
    img{
        width:55px;
        height: 55px;
    }

}
.group_info{
    margin-top: 6px;
}
</style>
